package com.sg.dto.biz.component.common;

import com.sg.common.dto.BaseDto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Objects;

/**
 * @desc SumOfMultipleNumDto
 * @使用场景
 */
@Data
public class SumOfMultipleNumDto extends BaseDto implements Serializable {

    /**
     * 通用主键ID
     */
    @NotNull(message = "通用主键ID不能为空")
    @ApiModelProperty("通用主键ID")
    private String commPrimaryKey;

    /**
     * 计算入参1
     */
    @NotNull(message = "计算入参1不能为空")
    @ApiModelProperty("计算入参1")
    private Double calcPara1;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        if (!super.equals(o)) return false;
        SumOfMultipleNumDto that = (SumOfMultipleNumDto) o;
        return commPrimaryKey == that.commPrimaryKey && calcPara1 == that.calcPara1;
    }

    @Override
    public int hashCode() {
        return Objects.hash(super.hashCode(), commPrimaryKey, calcPara1);
    }

}
